package com.tc.infinitechat.authenticationservice.controller;

import com.tc.infinitechat.authenticationservice.common.Result;
import com.tc.infinitechat.authenticationservice.data.common.sms.SMSRequest;
import com.tc.infinitechat.authenticationservice.data.common.sms.SMSResponse;
import com.tc.infinitechat.authenticationservice.data.user.register.RegisterRequest;
import com.tc.infinitechat.authenticationservice.data.user.register.RegisterResponse;
import com.tc.infinitechat.authenticationservice.data.user.upload.UploadRequest;
import com.tc.infinitechat.authenticationservice.data.user.upload.UploadResponse;
import com.tc.infinitechat.authenticationservice.service.CommonService;
import com.tc.infinitechat.authenticationservice.service.UserService;
import io.minio.messages.Upload;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @ClassName UserController
 * @Author 大马鲛鱼丸Gaga
 * @Description TODO
 * @Date 2025/10/8 14:37
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/user/common")
public class CommonController {
    @Autowired
    private CommonService commonService;
    @GetMapping("/sms")
    public Result<SMSResponse> sendSms(@RequestBody SMSRequest smsRequest){
        // 短信发送服务
        SMSResponse smsResponse = commonService.sendSms(smsRequest);
        return Result.success(smsResponse);
    }

    @GetMapping("/uploadUrl")
    public Result<UploadResponse> getUploadUrl(@Valid UploadRequest request) {
        UploadResponse uploadResponse = commonService.uploadUrl(request);
        return Result.success(uploadResponse);
    }
}
